<extend name="Public/base" />
<block name="body">
<div class="m-tab s-tab">
	<h2 class="u-tt">插件管理</h2>
	<ul>
		<li class="z-crt"><a href="{:U('index')}">插件列表</a></li>
		<li><a href="{:U('create')}">添加插件</a></li>
	</ul>
</div>
<table class="m-table m-table-row" id="table">
	<thead class="m-table-thead s-table-thead">
		<tr>
			<th class="cola">ID</th>
			<th class="colc">名称</th>
			<th class="colc">标识</th>
			<th>描述</th>
			<th width="43px">状态</th>
			<th class="cola">作者</th>
			<th width="43px">版本</th>
			<th class="colb">操作</th>
		</tr>
	</thead>
	<tbody>
		<notempty name="_list">
		<volist name="_list" id="vo">
		<tr>
			<td>{$vo.id}</td>
			<td>{$vo.title}</td>
			<td>{$vo.name}</td>
			<td>{$vo.description}</td>
			<td>{$vo.status_text|default="未安装"}</td>
        	<td><a target="_blank" href="{$vo.url|default='http://wwww.duxshop.com/'}">{$vo.author}</a></td>
			<td>{$vo.version}</td>
			<td>
				<empty name="vo.uninstall">
				<?php
				$class	= get_addon_class($vo['name']);
				if(!class_exists($class)){
					$has_config = 0;
				}else{
					$addon = new $class();
					$has_config = count($addon->getConfig());
				}
				?>
				<?php if ($has_config): ?>
				<a href="{:U('config',array('id'=>$vo['id']))}">设置</a>
				<?php endif ?>
				<?php if ($vo['status'] >=0): ?>
				<eq name="vo.status" value="0">
					<a class="ajax-get" href="javascript:;" url="{:U('enable',array('id'=>$vo['id']))}">启用</a>
				<else />
					<a class="ajax-get" href="javascript:;" url="{:U('disable',array('id'=>$vo['id']))}">禁用</a>
				</eq>
				<?php endif ?>
				{// <eq name="vo.author" value="thinkphp">}
				<a class="ajax-get" href="javascript:;" url="{:U('uninstall?id='.$vo['id'])}">卸载</a>
				{// </eq>}
				<else />
				<a class="ajax-get" href="javascript:;" url="{:U('install?addon_name='.$vo['name'])}">安装</a>
				</empty>
			</td>
		</tr>
		</volist>
		<else/>
		<tr>
			<td colspan="8" class="text-center"> aOh! 暂时还没有内容! </td>
		</tr>
		</notempty>
	</tbody>
</table>
<div class="m-table-tool">
	<div class="m-page">{$_page}</div>
</div>
</block>
<block name="script">
<script>
Do.ready('base','dialog',function() {


});
</script>
</block>